import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { EightyDefenseCopyInfo } from "./info/EightyDefenseCopyInfo";
type int = number;
//class EightyDefenseCopyConfig
    
    export  class EightyDefenseCopyConfig
    {
        constructor()
        {
            
            this._eightyDefenseMap = new Map<any, any> /* flash.utils.Dictionary */();
            if (EightyDefenseCopyConfig._instance != null) 
            {
                throw new Error("EightyDefenseCopyConfig 单例");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_80_defense_copy_config.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new EightyDefenseCopyInfo();
                loc1.copyCode = loc2.copyCode;
                loc1.id = loc2.id;
                loc1.skillId = loc2.skillId;
                loc1.useScore = loc2.useScore;
                this._eightyDefenseMap[loc1.skillId] = loc1;
            }
            return;
        }

        public getSkillInfoByCopyCode(arg1: int): Map<any, any> /* flash.utils.Dictionary */
        {
            var loc2=null;
            var loc1=new Map<any, any> /* flash.utils.Dictionary */();
            var loc3=0;
            var loc4=this._eightyDefenseMap;
            for(loc2 of loc4) 
            {
                if (loc2.copyCode != arg1) 
                {
                    continue;
                }
                loc1[loc2.skillId] = loc2;
            }
            return loc1;
        }

        public getSkillNumByCopyCode(arg1: int): int
        {
            var loc2=null;
            var loc1=0;
            var loc3=0;
            var loc4=this._eightyDefenseMap;
            for(loc2 of loc4) 
            {
                if (loc2.copyCode != arg1) 
                {
                    continue;
                }
                loc1 = loc1 + 1;
            }
            return loc1;
        }

        public getSkillUseScoreById(arg1: int): int
        {
            var loc1=this._eightyDefenseMap[arg1];
            var loc2=0;
            if (loc1) 
            {
                loc2 = loc1.useScore;
            }
            return loc2;
        }

        public isEightyDefenseSkill(arg1: int): Boolean
        {
            var loc1=false;
            var loc2=this._eightyDefenseMap[arg1];
            if (loc2) 
            {
                loc1 = true;
            }
            return loc1;
        }

        public static get instance(): EightyDefenseCopyConfig
        {
            if (EightyDefenseCopyConfig._instance == null) 
            {
                EightyDefenseCopyConfig._instance = new EightyDefenseCopyConfig();
            }
            return EightyDefenseCopyConfig._instance;
        }

        /* internal */ /* var */_eightyDefenseMap: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: EightyDefenseCopyConfig;
    }
